home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global slide
- set slide to 0
- reset()
- doMusicGeneral()
- end
-
- on enterFrame
- set the checkboxType to 0
- end
-
- on reset
- global myList, ElencoModelle
- set myList to list()
- set ElencoModelle to list()
- VisualizzaTutto(11, 21)
- set the text of field "nome" to " "
- set the text of field "data" to " "
- set the text of field "produzione" to " "
- set the text of field "dati" to " "
- set the checkboxType to 0
- set the hilite of member "1o" to 0
- set the hilite of member "2o" to 0
- set the hilite of member "3o" to 0
- set the hilite of member "4o" to 0
- set the hilite of member "1c" to 0
- set the hilite of member "2c" to 0
- set the hilite of member "3c" to 0
- set the hilite of member "4c" to 0
- set the hilite of member "1s" to 0
- set the hilite of member "2s" to 0
- set the hilite of member "3s" to 0
- end
-
- on cercaModelle
- global myList, ElencoModelle, indice
- set ElencoModelle to list()
- set choice to costruisciRicerca()
- set occhi to getAt(myList, 4)
- set capelli to getAt(myList, 5)
- set seno to getAt(myList, 6)
- case choice of
- "c":
- verificaAttrib(0, 1, capelli)
- "o":
- verificaAttrib(1, 1, occhi)
- "s":
- verificaAttrib(2, 1, seno)
- "oc":
- verificaAttrib(0, 2, EMPTY)
- "cs":
- verificaAttrib(1, 2, EMPTY)
- "os":
- verificaAttrib(2, 2, EMPTY)
- "ocs":
- verificaAttrib(3, 3, EMPTY)
- end case
- set indice to 1
- if count(ElencoModelle) > 0 then
- go(#next)
- BuildcastingSheet("a")
- else
- alert("Nessun elemento trovato")
- end if
- end
-
- on verificaAttrib pos, numVal, valore
- global myList, ElencoModelle, listaDatiModelle
- set listaDatiModelle to EMPTY
- set listaDatiModelle to the text of field "DBTXT"
- set numeroLinee to the lineCount of member "DBTXT" - 1
- set occhi to getAt(myList, 4)
- set capelli to getAt(myList, 5)
- set seno to getAt(myList, 6)
- set posizione to 3
- set offset to 9
- case numVal of
- 1:
- set valch to EMPTY & valore & EMPTY
- if seno <> -1 then
- repeat with i = 0 to numeroLinee
- set elem to posizione + (i * offset) + pos
- set attributo to item elem of listaDatiModelle
- if ((attributo <= "85") and (seno = 1)) or ((attributo < "90") and (seno = 2)) or ((attributo >= "90") and (seno = 3)) then
- append(ElencoModelle, i + 1)
- end if
- end repeat
- else
- repeat with i = 0 to numeroLinee
- set elem to posizione + (i * offset) + pos
- set attributo to item elem of listaDatiModelle
- if attributo = valch then
- append(ElencoModelle, i + 1)
- put i
- end if
- end repeat
- end if
- 2:
- case pos of
- 0:
- set chcapelli to EMPTY & capelli & EMPTY
- set chocchi to EMPTY & occhi & EMPTY
- repeat with i = 0 to numeroLinee
- set attribCapelli to item posizione + (i * offset) of listaDatiModelle
- if attribCapelli = chcapelli then
- set attribOcchi to item posizione + (i * offset) + 1 of listaDatiModelle
- if attribOcchi = chocchi then
- append(ElencoModelle, i + 1)
- end if
- end if
- end repeat
- 1:
- set chcapelli to EMPTY & capelli & EMPTY
- repeat with i = 0 to numeroLinee
- set attribCapelli to item posizione + (i * offset) of listaDatiModelle
- if attribCapelli = chcapelli then
- set attribSeno to item posizione + (i * offset) + 2 of listaDatiModelle
- if ((attribSeno <= "85") and (seno = 1)) or ((attribSeno < "90") and (seno = 2)) or ((attribSeno >= "90") and (seno = 3)) then
- append(ElencoModelle, i + 1)
- end if
- end if
- end repeat
- 2:
- set chocchi to EMPTY & occhi & EMPTY
- repeat with i = 0 to numeroLinee
- set attribOcchi to item posizione + (i * offset) + 1 of listaDatiModelle
- if attribOcchi = chocchi then
- set attribSeno to item posizione + (i * offset) + 2 of listaDatiModelle
- if ((attribSeno <= "85") and (seno = 1)) or ((attribSeno < "90") and (seno = 2)) or ((attribSeno >= "90") and (seno = 3)) then
- append(ElencoModelle, i + 1)
- end if
- end if
- end repeat
- end case
- 3:
- set chcapelli to EMPTY & capelli & EMPTY
- set chocchi to EMPTY & occhi & EMPTY
- repeat with i = 0 to numeroLinee
- set attribCapelli to item posizione + (i * offset) of listaDatiModelle
- if attribCapelli = chcapelli then
- set attribOcchi to item posizione + (i * offset) + 1 of listaDatiModelle
- if attribOcchi = chocchi then
- set attribSeno to item posizione + (i * offset) + 2 of listaDatiModelle
- if ((attribSeno <= "85") and (seno = 1)) or ((attribSeno < "90") and (seno = 2)) or ((attribSeno >= "90") and (seno = 3)) then
- append(ElencoModelle, i + 1)
- end if
- end if
- end if
- end repeat
- end case
- end
-
- on costruisciRicerca
- global myList
- append(myList, the text of field "nome")
- append(myList, the text of field "data")
- append(myList, the text of field "produzione")
- set caso to EMPTY
- set val to -1
- repeat with i = 1 to 4
- set nome to i & "o"
- if the hilite of member nome = 1 then
- set val to i
- put "o" after caso
- exit repeat
- end if
- end repeat
- append(myList, val)
- set val to -1
- repeat with i = 1 to 4
- set nome to i & "c"
- if the hilite of member nome = 1 then
- put "c" after caso
- set val to i
- exit repeat
- end if
- end repeat
- append(myList, val)
- set val to -1
- repeat with i = 1 to 3
- set nome to i & "s"
- if the hilite of member nome = 1 then
- put "s" after caso
- set val to i
- exit repeat
- end if
- end repeat
- append(myList, val)
- return caso
- end
-
- on BuildcastingSheet premuto
- global ElencoModelle, indice
- inizializzaPaginaModello()
- set numeroElementiLista to count(ElencoModelle)
- case premuto of
- "i":
- set indice to indice - 2
- if indice < 1 then
- set indice to indice + 2
- else
- if indice = 1 then
- set linea1 to getAt(ElencoModelle, indice)
- if numeroElementiLista > 1 then
- set linea2 to getAt(ElencoModelle, indice + 1)
- else
- set linea2 to -1
- end if
- else
- set linea1 to getAt(ElencoModelle, indice - 2)
- if numeroElementiLista > 1 then
- set linea2 to getAt(ElencoModelle, indice - 1)
- else
- set linea2 to -1
- end if
- riempiPagina(linea1, linea2)
- end if
- end if
- "a":
- set linea2 to -1
- if (numeroElementiLista - indice) < 0 then
- else
- if (numeroElementiLista - indice + 1) <> 1 then
- set linea1 to getAt(ElencoModelle, indice)
- set linea2 to getAt(ElencoModelle, indice + 1)
- set indice to indice + 2
- riempiPagina(linea1, linea2)
- else
- set linea1 to getAt(ElencoModelle, indice)
- set indice to indice + 2
- riempiPagina(linea1, -1)
- end if
- end if
- end case
- end
-
- on inizializzaPaginaModello
- disabilitaTutto(28, 31)
- put " " into field "nome1"
- put " " into field "nome2"
- put " " into field "dati1"
- put " " into field "dati2"
- puppetSprite(35, 0)
- put " " into field "dati"
- end
-
- on riempiPagina linea1, linea2
- set nomeImm1 to item 1 of line linea1 of field "DBTXT" & ".SMA"
- puppetSprite(28, 1)
- set the memberNum of sprite 28 to the number of member nomeImm1
- spriteBox(28, 50, 64, 133, 184)
- updateStage()
- riempiCampo(linea1, "nome1", "dati1", 0)
- assegnaLogo(30, char 1 of nomeImm1 & "SM.PIC")
- if linea2 <> -1 then
- set nomeImm2 to item 1 of line linea2 of field "DBTXT" & ".SMA"
- puppetSprite(29, 1)
- set the memberNum of sprite 29 to the number of member nomeImm2
- spriteBox(29, 50, 264, 133, 384)
- updateStage()
- riempiCampo(linea2, "nome2", "dati2", 0)
- assegnaLogo(31, char 1 of nomeImm2 & "SM.PIC")
- end if
- updateStage()
- end
-
- on assegnaLogo whichSprite, nomeImm
- set x to the left of sprite whichSprite
- set y to the top of sprite whichSprite
- puppetSprite(whichSprite, 1)
- set the memberNum of sprite whichSprite to the number of member nomeImm
- spriteBox(whichSprite, x, y, x + the width of member nomeImm, y + the height of member nomeImm)
- updateStage()
- end
-
- on riempiCampo linea, nomeField1, nomeField2, where
- set nome2 to item 9 of line linea of field "DBTXT"
- set cognome2 to item 8 of line linea of field "DBTXT"
- set altezza2 to item 2 of line linea of field "DBTXT"
- set seno2 to item 5 of line linea of field "DBTXT"
- set vita2 to item 6 of line linea of field "DBTXT"
- set fianchi2 to item 7 of line linea of field "DBTXT"
- if (cognome2 = 0) or (cognome2 = "0") then
- put RETURN & nome2 into field nomeField1
- else
- put RETURN & nome2 & " " & cognome2 into field nomeField1
- end if
- put RETURN after field nomeField1
- put RETURN & altezza2 & " cm" after field nomeField1
- put RETURN after field nomeField1
- put RETURN & seno2 & "-" & vita2 & "-" & fianchi2 after field nomeField1
- updateStage()
- set num to item 4 of line linea of field "DBTXT"
- set colOcchi1 to coloreOcchi(num)
- set num to item 3 of line linea of field "DBTXT"
- set colCapelli1 to coloreCapelli(num)
- if where = 1 then
- put RETURN after field nomeField1
- put RETURN & "Occhi " & colOcchi1 after field nomeField1
- put RETURN after field nomeField1
- put RETURN & "Capelli " & colCapelli1 after field nomeField1
- else
- put RETURN & "Occhi " & colOcchi1 into field nomeField2
- put RETURN after field nomeField2
- put RETURN & "Capelli " & colCapelli1 after field nomeField2
- end if
- if nomeField2 <> EMPTY then
- set the foreColor of member nomeField2 to 0
- set the textFont of member nomeField2 to "Helvetica"
- set the textSize of member nomeField2 to 12
- set the textStyle of member nomeField2 to "Bold"
- updateStage()
- end if
- end
-
- on calcoloEstremi premuto
- global indice, ElencoModelle
- set q to count(ElencoModelle) / 2
- if ((indice = 3) and (premuto = "i")) or ((indice >= q) and (premuto = "a")) then
- alert("Operazione non permessa")
- else
- if indice <> 0 then
- set s to indice / 2
- if q = s then
- if premuto = "i" then
- set V to 0
- else
- set V to -1
- end if
- else
- if s = 1 then
- if premuto = "a" then
- set V to 0
- else
- set V to -1
- end if
- else
- set V to q - (s + 1)
- end if
- end if
- else
- set V to 0
- end if
- end if
- return V
- end
-
- on coloreOcchi num
- case num of
- 1, "1":
- set colore to "castani"
- 2, "2":
- set colore to "neri"
- 3, "3":
- set colore to "azzurri"
- 4, "4":
- set colore to "verdi"
- end case
- return colore
- end
-
- on coloreCapelli num
- case num of
- 1, "1":
- set colore to "castani"
- 2, "2":
- set colore to "neri"
- 3, "3":
- set colore to "rossi"
- 4, "4":
- set colore to "biondi"
- end case
- return colore
- end
-
- on NascondiTutto inf, sup
- repeat with i = inf to sup
- puppetSprite(i, 0)
- end repeat
- end
-
- on VisualizzaTutto inf, sup
- repeat with i = inf to sup
- set the visible of sprite i to 1
- end repeat
- end
-
- on NascondiAltri whichSprite, inf, sup
- repeat with i = inf to sup
- if i <> whichSprite then
- set the visible of sprite i to 0
- end if
- end repeat
- end
-
- on testRollOverButton
- if rollOver(4) then
- disabilitaAltri(4, 4, 6)
- flashRoller(4, 34, EMPTY)
- else
- if rollOver(5) then
- disabilitaAltri(5, 4, 6)
- flashRoller(5, 36, EMPTY)
- else
- if rollOver(6) then
- disabilitaAltri(6, 4, 6)
- flashRoller(6, 38, EMPTY)
- else
- disabilitaTutto(4, 6)
- end if
- end if
- end if
- end
-
- on notAvaRollOverButton
- if rollOver(4) then
- disabilitaAltri(4, 4, 6)
- flashRoller(4, 34, EMPTY)
- else
- if rollOver(6) then
- disabilitaAltri(6, 4, 6)
- flashRoller(6, 38, EMPTY)
- else
- disabilitaTutto(4, 6)
- end if
- end if
- end
-
- on notIndRollOverButton
- if rollOver(5) then
- disabilitaAltri(5, 4, 6)
- flashRoller(5, 36, EMPTY)
- else
- if rollOver(6) then
- disabilitaAltri(6, 4, 6)
- flashRoller(6, 38, EMPTY)
- else
- disabilitaTutto(4, 6)
- end if
- end if
- end
-
- on disabilitaAltri whichSprite, inf, sup
- repeat with i = inf to sup
- if i <> whichSprite then
- puppetSprite(i, 0)
- end if
- end repeat
- end
-
- on disabilitaTutto inf, sup
- repeat with i = inf to sup
- puppetSprite(i, 0)
- end repeat
- end
-
- on abilitaTutto inf, sup
- repeat with i = inf to sup
- puppetSprite(i, 1)
- end repeat
- end
-
- on flashRoller whichSprite, numCast, scriptToExecute
- puppetSprite(whichSprite, 1)
- set myCast to numCast
- set the memberNum of sprite whichSprite to myCast + 1
- updateStage()
- do(scriptToExecute)
- end
-